package model.moving
{
	public class Quickness implements Movement
	{
		public function move(oldX:Number, oldY:Number, newX:Number, newY:Number):Boolean
		{
			if ((Math.abs(oldX - newX) == 1) && (Math.abs(oldY - newY) == 1)) return true
			else return moveNormal(oldX,oldY,newX,newY);
		}
		
		public function moveNormal(oldX:Number, oldY:Number, newX:Number, newY:Number):Boolean
		{
			var isLegal:Boolean = false;
			
			if (((oldX == (newX+1)) || (oldX == (newX - 1))) && (oldY == newY)){
				isLegal = true;
			}
			else if (((oldY == (newY + 1)) || (oldY == (newY - 1))) && (oldX == newX)){
				isLegal = true;
			}
			
			return isLegal;
		}
	}
}